<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html><head><title>QDialogButtonBox Class Reference</title><style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }
td.postheader { font-family: sans-serif }
tr.address { font-family: sans-serif }
body { background: #ffffff; color: black; }
</style></head><body><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr /><td align="left" valign="top" width="32"><img align="left" border="0" height="32" src="images/rb-logo.png" width="32" /></td><td width="1">&#160;&#160;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a>&#160;&#183; <a href="classes.html"><font color="#004faf">All Classes</font></a>&#160;&#183; <a href="modules.html"><font color="#004faf">Modules</font></a></td></table><h1 align="center">QDialogButtonBox Class Reference<br /><sup><sup>[<a href="qtgui.html">QtGui</a> module]</sup></sup></h1><p>The QDialogButtonBox class is a widget that presents buttons in
a layout that is appropriate to the current widget style. <a href="#details">More...</a></p>

<p>Inherits <a href="qwidget.html">QWidget</a>.</p><h3>Types</h3><ul><li><div class="fn" />enum <b><a href="qdialogbuttonbox.html#ButtonLayout-enum">ButtonLayout</a></b> { WinLayout, MacLayout, KdeLayout, GnomeLayout }</li><li><div class="fn" />enum <b><a href="qdialogbuttonbox.html#ButtonRole-enum">ButtonRole</a></b> { InvalidRole, AcceptRole, RejectRole, DestructiveRole, ..., ApplyRole }</li><li><div class="fn" />enum <b><a href="qdialogbuttonbox.html#StandardButton-enum">StandardButton</a></b> { NoButton, Ok, Save, SaveAll, ..., RestoreDefaults }</li><li><div class="fn" />class <b><a href="qdialogbuttonbox-standardbuttons.html">StandardButtons</a></b></li></ul><h3>Methods</h3><ul><li><div class="fn" /><b><a href="qdialogbuttonbox.html#QDialogButtonBox">__init__</a></b> (<i>self</i>, QWidget&#160;<i>parent</i>&#160;=&#160;None)</li><li><div class="fn" /><b><a href="qdialogbuttonbox.html#QDialogButtonBox-2">__init__</a></b> (<i>self</i>, Qt.Orientation&#160;<i>orientation</i>, QWidget&#160;<i>parent</i>&#160;=&#160;None)</li><li><div class="fn" /><b><a href="qdialogbuttonbox.html#QDialogButtonBox-3">__init__</a></b> (<i>self</i>, StandardButtons&#160;<i>buttons</i>, Qt.Orientation&#160;<i>orientation</i>&#160;=&#160;Qt.Horizontal, QWidget&#160;<i>parent</i>&#160;=&#160;None)</li><li><div class="fn" /><b><a href="qdialogbuttonbox.html#addButton">addButton</a></b> (<i>self</i>, QAbstractButton&#160;<i>button</i>, ButtonRole&#160;<i>role</i>)</li><li><div class="fn" />QPushButton <b><a href="qdialogbuttonbox.html#addButton-2">addButton</a></b> (<i>self</i>, QString&#160;<i>text</i>, ButtonRole&#160;<i>role</i>)</li><li><div class="fn" />QPushButton <b><a href="qdialogbuttonbox.html#addButton-3">addButton</a></b> (<i>self</i>, StandardButton&#160;<i>button</i>)</li><li><div class="fn" />QPushButton <b><a href="qdialogbuttonbox.html#button">button</a></b> (<i>self</i>, StandardButton&#160;<i>which</i>)</li><li><div class="fn" />ButtonRole <b><a href="qdialogbuttonbox.html#buttonRole">buttonRole</a></b> (<i>self</i>, QAbstractButton&#160;<i>button</i>)</li><li><div class="fn" />list-of-QAbstractButton <b><a href="qdialogbuttonbox.html#buttons">buttons</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qdialogbuttonbox.html#centerButtons">centerButtons</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qdialogbuttonbox.html#changeEvent">changeEvent</a></b> (<i>self</i>, QEvent&#160;<i>event</i>)</li><li><div class="fn" /><b><a href="qdialogbuttonbox.html#clear">clear</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qdialogbuttonbox.html#event">event</a></b> (<i>self</i>, QEvent&#160;<i>event</i>)</li><li><div class="fn" />Qt.Orientation <b><a href="qdialogbuttonbox.html#orientation">orientation</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qdialogbuttonbox.html#removeButton">removeButton</a></b> (<i>self</i>, QAbstractButton&#160;<i>button</i>)</li><li><div class="fn" /><b><a href="qdialogbuttonbox.html#setCenterButtons">setCenterButtons</a></b> (<i>self</i>, bool&#160;<i>center</i>)</li><li><div class="fn" /><b><a href="qdialogbuttonbox.html#setOrientation">setOrientation</a></b> (<i>self</i>, Qt.Orientation&#160;<i>orientation</i>)</li><li><div class="fn" /><b><a href="qdialogbuttonbox.html#setStandardButtons">setStandardButtons</a></b> (<i>self</i>, StandardButtons&#160;<i>buttons</i>)</li><li><div class="fn" />StandardButton <b><a href="qdialogbuttonbox.html#standardButton">standardButton</a></b> (<i>self</i>, QAbstractButton&#160;<i>button</i>)</li><li><div class="fn" />StandardButtons <b><a href="qdialogbuttonbox.html#standardButtons">standardButtons</a></b> (<i>self</i>)</li></ul><h3>Qt Signals</h3><ul><li><div class="fn" />void <b><a href="qdialogbuttonbox.html#accepted">accepted</a></b> ()</li><li><div class="fn" />void <b><a href="qdialogbuttonbox.html#clicked">clicked</a></b> (QAbstractButton *)</li><li><div class="fn" />void <b><a href="qdialogbuttonbox.html#helpRequested">helpRequested</a></b> ()</li><li><div class="fn" />void <b><a href="qdialogbuttonbox.html#rejected">rejected</a></b> ()</li></ul><a name="details" /><hr /><h2>Detailed Description</h2><p>The QDialogButtonBox class is a widget that presents buttons in
a layout that is appropriate to the current widget style.</p>
<p>Dialogs and message boxes typically present buttons in a layout
that conforms to the interface guidelines for that platform.
Invariably, different platforms have different layouts for their
dialogs. QDialogButtonBox allows a developer to add buttons to it
and will automatically use the appropriate layout for the user's
desktop environment.</p>
<p>Most buttons for a dialog follow certain roles. Such roles
include:</p>
<ul>
<li>Accepting or rejecting the dialog.</li>
<li>Asking for help.</li>
<li>Performing actions on the dialog itself (such as resetting
fields or applying changes).</li>
</ul>
<p>There can also be alternate ways of dismissing the dialog which
may cause destructive results.</p>
<p>Most dialogs have buttons that can almost be considered standard
(e.g. <b>OK</b> and <b>Cancel</b> buttons). It is sometimes
convenient to create these buttons in a standard way.</p>
<p>There are a couple ways of using QDialogButtonBox. One ways is
to create the buttons (or button texts) yourself and add them to
the button box, specifying their role.</p>
<pre class="cpp">
     findButton <span class="operator">=</span> <span class="keyword">new</span> <span class="type"><a href="qpushbutton.html">QPushButton</a></span>(tr(<span class="string">"&amp;Find"</span>));
     findButton<span class="operator">-</span><span class="operator">&gt;</span>setDefault(<span class="keyword">true</span>);

     moreButton <span class="operator">=</span> <span class="keyword">new</span> <span class="type"><a href="qpushbutton.html">QPushButton</a></span>(tr(<span class="string">"&amp;More"</span>));
     moreButton<span class="operator">-</span><span class="operator">&gt;</span>setCheckable(<span class="keyword">true</span>);
     moreButton<span class="operator">-</span><span class="operator">&gt;</span>setAutoDefault(<span class="keyword">false</span>);

     buttonBox <span class="operator">=</span> <span class="keyword">new</span> <span class="type">QDialogButtonBox</span>(<span class="type"><a href="qt.html">Qt</a></span><span class="operator">.</span>Vertical);
     buttonBox<span class="operator">-</span><span class="operator">&gt;</span>addButton(findButton<span class="operator">,</span> <span class="type">QDialogButtonBox</span><span class="operator">.</span>ActionRole);
     buttonBox<span class="operator">-</span><span class="operator">&gt;</span>addButton(moreButton<span class="operator">,</span> <span class="type">QDialogButtonBox</span><span class="operator">.</span>ActionRole);
</pre>
<p>Alternatively, QDialogButtonBox provides several standard
buttons (e.g. OK, Cancel, Save) that you can use. They exist as
flags so you can OR them together in the constructor.</p>
<pre class="cpp">
     buttonBox <span class="operator">=</span> <span class="keyword">new</span> <span class="type">QDialogButtonBox</span>(<span class="type">QDialogButtonBox</span><span class="operator">.</span>Ok
                                      <span class="operator">|</span> <span class="type">QDialogButtonBox</span><span class="operator">.</span>Cancel);

     connect(buttonBox<span class="operator">,</span> SIGNAL(accepted())<span class="operator">,</span> <span class="keyword">this</span><span class="operator">,</span> SLOT(accept()));
     connect(buttonBox<span class="operator">,</span> SIGNAL(rejected())<span class="operator">,</span> <span class="keyword">this</span><span class="operator">,</span> SLOT(reject()));
</pre>
<p>You can mix and match normal buttons and standard buttons.</p>
<p>Currently the buttons are laid out in the following way if the
button box is horizontal:</p>
<table class="generic">
<tr class="odd" valign="top">
<td><img alt="GnomeLayout Horizontal" src="images/buttonbox-gnomelayout-horizontal.png" /></td>
<td>Button box laid out in horizontal <a href="qdialogbuttonbox.html#ButtonLayout-enum">GnomeLayout</a></td>
</tr>
<tr class="even" valign="top">
<td><img alt="KdeLayout Horizontal" src="images/buttonbox-kdelayout-horizontal.png" /></td>
<td>Button box laid out in horizontal <a href="qdialogbuttonbox.html#ButtonLayout-enum">KdeLayout</a></td>
</tr>
<tr class="odd" valign="top">
<td><img alt="MacLayout Horizontal" src="images/buttonbox-maclayout-horizontal.png" /></td>
<td>Button box laid out in horizontal <a href="qdialogbuttonbox.html#ButtonLayout-enum">MacLayout</a></td>
</tr>
<tr class="even" valign="top">
<td><img alt="WinLayout Horizontal" src="images/buttonbox-winlayout-horizontal.png" /></td>
<td>Button box laid out in horizontal <a href="qdialogbuttonbox.html#ButtonLayout-enum">WinLayout</a></td>
</tr>
</table>
<p>The buttons are laid out the following way if the button box is
vertical:</p>
<table class="generic">
<tr class="odd" valign="top">
<td><a href="qdialogbuttonbox.html#ButtonLayout-enum">GnomeLayout</a></td>
<td><a href="qdialogbuttonbox.html#ButtonLayout-enum">KdeLayout</a></td>
<td><a href="qdialogbuttonbox.html#ButtonLayout-enum">MacLayout</a></td>
<td><a href="qdialogbuttonbox.html#ButtonLayout-enum">WinLayout</a></td>
</tr>
<tr class="even" valign="top">
<td><img alt="GnomeLayout Vertical" src="images/buttonbox-gnomelayout-vertical.png" /></td>
<td><img alt="KdeLayout Vertical" src="images/buttonbox-kdelayout-vertical.png" /></td>
<td><img alt="MacLayout Vertical" src="images/buttonbox-maclayout-vertical.png" /></td>
<td><img alt="WinLayout Vertical" src="images/buttonbox-winlayout-vertical.png" /></td>
</tr>
</table>
<p>Additionally, button boxes that contain only buttons with
<a href="qdialogbuttonbox.html#ButtonRole-enum">ActionRole</a> or
<a href="qdialogbuttonbox.html#ButtonRole-enum">HelpRole</a> can be
considered modeless and have an alternate look on Mac OS X:</p>
<table class="generic">
<tr class="odd" valign="top">
<td>modeless horizontal <a href="qdialogbuttonbox.html#ButtonLayout-enum">MacLayout</a></td>
<td><img alt="Screenshot of modeless horizontal MacLayout" src="images/buttonbox-mac-modeless-horizontal.png" /></td>
</tr>
</table>
<p>When a button is clicked in the button box, the <a href="qdialogbuttonbox.html#clicked">clicked</a>() signal is emitted for
the actual button is that is pressed. For convenience, if the
button has an <a href="qdialogbuttonbox.html#ButtonRole-enum">AcceptRole</a>, <a href="qdialogbuttonbox.html#ButtonRole-enum">RejectRole</a>, or <a href="qdialogbuttonbox.html#ButtonRole-enum">HelpRole</a>, the <a href="qdialogbuttonbox.html#accepted">accepted</a>(), <a href="qdialogbuttonbox.html#rejected">rejected</a>(), or <a href="qdialogbuttonbox.html#helpRequested">helpRequested</a>() signals
are emitted respectively.</p>
<p>If you want a specific button to be default you need to call
<a href="qpushbutton.html#default-prop">QPushButton.setDefault</a>() on it
yourself. However, if there is no default button set and to
preserve which button is the default button across platforms when
using the <a href="qpushbutton.html#autoDefault-prop">QPushButton.autoDefault</a>
property, the first push button with the accept role is made the
default button when the QDialogButtonBox is shown,</p>
<hr /><h2>Type Documentation</h2><h3 class="fn"><a name="ButtonLayout-enum" />QDialogButtonBox.ButtonLayout</h3><p>This enum describes the layout policy to be used when arranging
the buttons contained in the button box.</p>
<table class="valuelist">
<tr class="odd" valign="top">
<th class="tblConst">Constant</th>
<th class="tblval">Value</th>
<th class="tbldscr">Description</th>
</tr>
<tr>
<td class="topAlign"><tt>QDialogButtonBox.WinLayout</tt></td>
<td class="topAlign"><tt>0</tt></td>
<td class="topAlign">Use a policy appropriate for applications on
Windows.</td>
</tr>
<tr>
<td class="topAlign"><tt>QDialogButtonBox.MacLayout</tt></td>
<td class="topAlign"><tt>1</tt></td>
<td class="topAlign">Use a policy appropriate for applications on
Mac OS X.</td>
</tr>
<tr>
<td class="topAlign"><tt>QDialogButtonBox.KdeLayout</tt></td>
<td class="topAlign"><tt>2</tt></td>
<td class="topAlign">Use a policy appropriate for applications on
KDE.</td>
</tr>
<tr>
<td class="topAlign"><tt>QDialogButtonBox.GnomeLayout</tt></td>
<td class="topAlign"><tt>3</tt></td>
<td class="topAlign">Use a policy appropriate for applications on
GNOME.</td>
</tr>
</table>
<p>The button layout is specified by the <a href="qwidget.html#style">current style</a>. However, on the X11
platform, it may be influenced by the desktop environment.</p>


<h3 class="fn"><a name="ButtonRole-enum" />QDialogButtonBox.ButtonRole</h3><p>This enum describes the roles that can be used to describe
buttons in the button box. Combinations of these roles are as flags
used to describe different aspects of their behavior.</p>
<table class="valuelist">
<tr class="odd" valign="top">
<th class="tblConst">Constant</th>
<th class="tblval">Value</th>
<th class="tbldscr">Description</th>
</tr>
<tr>
<td class="topAlign"><tt>QDialogButtonBox.InvalidRole</tt></td>
<td class="topAlign"><tt>-1</tt></td>
<td class="topAlign">The button is invalid.</td>
</tr>
<tr>
<td class="topAlign"><tt>QDialogButtonBox.AcceptRole</tt></td>
<td class="topAlign"><tt>0</tt></td>
<td class="topAlign">Clicking the button causes the dialog to be
accepted (e.g. OK).</td>
</tr>
<tr>
<td class="topAlign"><tt>QDialogButtonBox.RejectRole</tt></td>
<td class="topAlign"><tt>1</tt></td>
<td class="topAlign">Clicking the button causes the dialog to be
rejected (e.g. Cancel).</td>
</tr>
<tr>
<td class="topAlign">
<tt>QDialogButtonBox.DestructiveRole</tt></td>
<td class="topAlign"><tt>2</tt></td>
<td class="topAlign">Clicking the button causes a destructive
change (e.g. for Discarding Changes) and closes the dialog.</td>
</tr>
<tr>
<td class="topAlign"><tt>QDialogButtonBox.ActionRole</tt></td>
<td class="topAlign"><tt>3</tt></td>
<td class="topAlign">Clicking the button causes changes to the
elements within the dialog.</td>
</tr>
<tr>
<td class="topAlign"><tt>QDialogButtonBox.HelpRole</tt></td>
<td class="topAlign"><tt>4</tt></td>
<td class="topAlign">The button can be clicked to request
help.</td>
</tr>
<tr>
<td class="topAlign"><tt>QDialogButtonBox.YesRole</tt></td>
<td class="topAlign"><tt>5</tt></td>
<td class="topAlign">The button is a "Yes"-like button.</td>
</tr>
<tr>
<td class="topAlign"><tt>QDialogButtonBox.NoRole</tt></td>
<td class="topAlign"><tt>6</tt></td>
<td class="topAlign">The button is a "No"-like button.</td>
</tr>
<tr>
<td class="topAlign"><tt>QDialogButtonBox.ApplyRole</tt></td>
<td class="topAlign"><tt>8</tt></td>
<td class="topAlign">The button applies current changes.</td>
</tr>
<tr>
<td class="topAlign"><tt>QDialogButtonBox.ResetRole</tt></td>
<td class="topAlign"><tt>7</tt></td>
<td class="topAlign">The button resets the dialog's fields to
default values.</td>
</tr>
</table>
<p><b>See also</b> <a href="qdialogbuttonbox.html#StandardButton-enum">StandardButton</a>.</p>


<h3 class="fn"><a name="StandardButton-enum" />QDialogButtonBox.StandardButton</h3><p>These enums describe flags for standard buttons. Each button has
a defined <a href="qdialogbuttonbox.html#ButtonRole-enum">ButtonRole</a>.</p>
<table class="valuelist">
<tr class="odd" valign="top">
<th class="tblConst">Constant</th>
<th class="tblval">Value</th>
<th class="tbldscr">Description</th>
</tr>
<tr>
<td class="topAlign"><tt>QDialogButtonBox.Ok</tt></td>
<td class="topAlign"><tt>0x00000400</tt></td>
<td class="topAlign">An "OK" button defined with the <a href="qdialogbuttonbox.html#ButtonRole-enum">AcceptRole</a>.</td>
</tr>
<tr>
<td class="topAlign"><tt>QDialogButtonBox.Open</tt></td>
<td class="topAlign"><tt>0x00002000</tt></td>
<td class="topAlign">A "Open" button defined with the <a href="qdialogbuttonbox.html#ButtonRole-enum">AcceptRole</a>.</td>
</tr>
<tr>
<td class="topAlign"><tt>QDialogButtonBox.Save</tt></td>
<td class="topAlign"><tt>0x00000800</tt></td>
<td class="topAlign">A "Save" button defined with the <a href="qdialogbuttonbox.html#ButtonRole-enum">AcceptRole</a>.</td>
</tr>
<tr>
<td class="topAlign"><tt>QDialogButtonBox.Cancel</tt></td>
<td class="topAlign"><tt>0x00400000</tt></td>
<td class="topAlign">A "Cancel" button defined with the <a href="qdialogbuttonbox.html#ButtonRole-enum">RejectRole</a>.</td>
</tr>
<tr>
<td class="topAlign"><tt>QDialogButtonBox.Close</tt></td>
<td class="topAlign"><tt>0x00200000</tt></td>
<td class="topAlign">A "Close" button defined with the <a href="qdialogbuttonbox.html#ButtonRole-enum">RejectRole</a>.</td>
</tr>
<tr>
<td class="topAlign"><tt>QDialogButtonBox.Discard</tt></td>
<td class="topAlign"><tt>0x00800000</tt></td>
<td class="topAlign">A "Discard" or "Don't Save" button, depending
on the platform, defined with the <a href="qdialogbuttonbox.html#ButtonRole-enum">DestructiveRole</a>.</td>
</tr>
<tr>
<td class="topAlign"><tt>QDialogButtonBox.Apply</tt></td>
<td class="topAlign"><tt>0x02000000</tt></td>
<td class="topAlign">An "Apply" button defined with the <a href="qdialogbuttonbox.html#ButtonRole-enum">ApplyRole</a>.</td>
</tr>
<tr>
<td class="topAlign"><tt>QDialogButtonBox.Reset</tt></td>
<td class="topAlign"><tt>0x04000000</tt></td>
<td class="topAlign">A "Reset" button defined with the <a href="qdialogbuttonbox.html#ButtonRole-enum">ResetRole</a>.</td>
</tr>
<tr>
<td class="topAlign">
<tt>QDialogButtonBox.RestoreDefaults</tt></td>
<td class="topAlign"><tt>0x08000000</tt></td>
<td class="topAlign">A "Restore Defaults" button defined with the
<a href="qdialogbuttonbox.html#ButtonRole-enum">ResetRole</a>.</td>
</tr>
<tr>
<td class="topAlign"><tt>QDialogButtonBox.Help</tt></td>
<td class="topAlign"><tt>0x01000000</tt></td>
<td class="topAlign">A "Help" button defined with the <a href="qdialogbuttonbox.html#ButtonRole-enum">HelpRole</a>.</td>
</tr>
<tr>
<td class="topAlign"><tt>QDialogButtonBox.SaveAll</tt></td>
<td class="topAlign"><tt>0x00001000</tt></td>
<td class="topAlign">A "Save All" button defined with the <a href="qdialogbuttonbox.html#ButtonRole-enum">AcceptRole</a>.</td>
</tr>
<tr>
<td class="topAlign"><tt>QDialogButtonBox.Yes</tt></td>
<td class="topAlign"><tt>0x00004000</tt></td>
<td class="topAlign">A "Yes" button defined with the <a href="qdialogbuttonbox.html#ButtonRole-enum">YesRole</a>.</td>
</tr>
<tr>
<td class="topAlign"><tt>QDialogButtonBox.YesToAll</tt></td>
<td class="topAlign"><tt>0x00008000</tt></td>
<td class="topAlign">A "Yes to All" button defined with the
<a href="qdialogbuttonbox.html#ButtonRole-enum">YesRole</a>.</td>
</tr>
<tr>
<td class="topAlign"><tt>QDialogButtonBox.No</tt></td>
<td class="topAlign"><tt>0x00010000</tt></td>
<td class="topAlign">A "No" button defined with the <a href="qdialogbuttonbox.html#ButtonRole-enum">NoRole</a>.</td>
</tr>
<tr>
<td class="topAlign"><tt>QDialogButtonBox.NoToAll</tt></td>
<td class="topAlign"><tt>0x00020000</tt></td>
<td class="topAlign">A "No to All" button defined with the <a href="qdialogbuttonbox.html#ButtonRole-enum">NoRole</a>.</td>
</tr>
<tr>
<td class="topAlign"><tt>QDialogButtonBox.Abort</tt></td>
<td class="topAlign"><tt>0x00040000</tt></td>
<td class="topAlign">An "Abort" button defined with the <a href="qdialogbuttonbox.html#ButtonRole-enum">RejectRole</a>.</td>
</tr>
<tr>
<td class="topAlign"><tt>QDialogButtonBox.Retry</tt></td>
<td class="topAlign"><tt>0x00080000</tt></td>
<td class="topAlign">A "Retry" button defined with the <a href="qdialogbuttonbox.html#ButtonRole-enum">AcceptRole</a>.</td>
</tr>
<tr>
<td class="topAlign"><tt>QDialogButtonBox.Ignore</tt></td>
<td class="topAlign"><tt>0x00100000</tt></td>
<td class="topAlign">An "Ignore" button defined with the <a href="qdialogbuttonbox.html#ButtonRole-enum">AcceptRole</a>.</td>
</tr>
<tr>
<td class="topAlign"><tt>QDialogButtonBox.NoButton</tt></td>
<td class="topAlign"><tt>0x00000000</tt></td>
<td class="topAlign">An invalid button.</td>
</tr>
</table>
<p>The StandardButtons type is a typedef for <a href="qflags.html">QFlags</a>&lt;StandardButton&gt;. It stores an OR
combination of StandardButton values.</p>
<p><b>See also</b> <a href="qdialogbuttonbox.html#ButtonRole-enum">ButtonRole</a> and <a href="qdialogbuttonbox.html#standardButtons-prop">standardButtons</a>.</p>
<hr /><h2>Method Documentation</h2><h3 class="fn"><a name="QDialogButtonBox" />QDialogButtonBox.__init__ (<i>self</i>, <a href="qwidget.html">QWidget</a>&#160;<i>parent</i>&#160;=&#160;None)</h3><p>The <i>parent</i> argument, if not None, causes <i>self</i> to be owned by Qt instead of PyQt.</p><p>Constructs an empty, horizontal button box with the given
<i>parent</i>.</p>
<p><b>See also</b> <a href="qdialogbuttonbox.html#orientation-prop">orientation</a> and
<a href="qdialogbuttonbox.html#addButton">addButton</a>().</p>


<h3 class="fn"><a name="QDialogButtonBox-2" />QDialogButtonBox.__init__ (<i>self</i>, <a href="qt.html#Orientation-enum">Qt.Orientation</a>&#160;<i>orientation</i>, <a href="qwidget.html">QWidget</a>&#160;<i>parent</i>&#160;=&#160;None)</h3><p>The <i>parent</i> argument, if not None, causes <i>self</i> to be owned by Qt instead of PyQt.</p><p>Constructs an empty button box with the given <i>orientation</i>
and <i>parent</i>.</p>
<p><b>See also</b> <a href="qdialogbuttonbox.html#orientation-prop">orientation</a> and
<a href="qdialogbuttonbox.html#addButton">addButton</a>().</p>


<h3 class="fn"><a name="QDialogButtonBox-3" />QDialogButtonBox.__init__ (<i>self</i>, <a href="qdialogbuttonbox-standardbuttons.html">StandardButtons</a>&#160;<i>buttons</i>, <a href="qt.html#Orientation-enum">Qt.Orientation</a>&#160;<i>orientation</i>&#160;=&#160;Qt.Horizontal, <a href="qwidget.html">QWidget</a>&#160;<i>parent</i>&#160;=&#160;None)</h3><p>The <i>parent</i> argument, if not None, causes <i>self</i> to be owned by Qt instead of PyQt.</p><p>Constructs a button box with the given <i>orientation</i> and
<i>parent</i>, containing the standard buttons specified by
<i>buttons</i>.</p>
<p><b>See also</b> <a href="qdialogbuttonbox.html#orientation-prop">orientation</a> and
<a href="qdialogbuttonbox.html#addButton">addButton</a>().</p>


<h3 class="fn"><a name="addButton" />QDialogButtonBox.addButton (<i>self</i>, <a href="qabstractbutton.html">QAbstractButton</a>&#160;<i>button</i>, <a href="qdialogbuttonbox.html#ButtonRole-enum">ButtonRole</a>&#160;<i>role</i>)</h3><p>The <i>button</i> argument has it's ownership transferred to Qt.</p><p>Adds the given <i>button</i> to the button box with the
specified <i>role</i>. If the role is invalid, the button is not
added.</p>
<p>If the button has already been added, it is removed and added
again with the new role.</p>
<p><b>Note:</b> The button box takes ownership of the button.</p>
<p><b>See also</b> <a href="qdialogbuttonbox.html#removeButton">removeButton</a>() and
<a href="qdialogbuttonbox.html#clear">clear</a>().</p>


<h3 class="fn"><a name="addButton-2" /><a href="qpushbutton.html">QPushButton</a> QDialogButtonBox.addButton (<i>self</i>, QString&#160;<i>text</i>, <a href="qdialogbuttonbox.html#ButtonRole-enum">ButtonRole</a>&#160;<i>role</i>)</h3><p>Creates a push button with the given <i>text</i>, adds it to the
button box for the specified <i>role</i>, and returns the
corresponding push button. If <i>role</i> is invalid, no button is
created, and zero is returned.</p>
<p><b>See also</b> <a href="qdialogbuttonbox.html#removeButton">removeButton</a>() and
<a href="qdialogbuttonbox.html#clear">clear</a>().</p>


<h3 class="fn"><a name="addButton-3" /><a href="qpushbutton.html">QPushButton</a> QDialogButtonBox.addButton (<i>self</i>, <a href="qdialogbuttonbox.html#StandardButton-enum">StandardButton</a>&#160;<i>button</i>)</h3><p>Adds a standard <i>button</i> to the button box if it is valid
to do so, and returns a push button. If <i>button</i> is invalid,
it is not added to the button box, and zero is returned.</p>
<p><b>See also</b> <a href="qdialogbuttonbox.html#removeButton">removeButton</a>() and
<a href="qdialogbuttonbox.html#clear">clear</a>().</p>


<h3 class="fn"><a name="button" /><a href="qpushbutton.html">QPushButton</a> QDialogButtonBox.button (<i>self</i>, <a href="qdialogbuttonbox.html#StandardButton-enum">StandardButton</a>&#160;<i>which</i>)</h3><p>Returns the <a href="qpushbutton.html">QPushButton</a>
corresponding to the standard button <i>which</i>, or 0 if the
standard button doesn't exist in this button box.</p>
<p><b>See also</b> <a href="qdialogbuttonbox.html#standardButton">standardButton</a>(),
<a href="qdialogbuttonbox.html#standardButtons-prop">standardButtons</a>(),
and <a href="qdialogbuttonbox.html#buttons">buttons</a>().</p>


<h3 class="fn"><a name="buttonRole" /><a href="qdialogbuttonbox.html#ButtonRole-enum">ButtonRole</a> QDialogButtonBox.buttonRole (<i>self</i>, <a href="qabstractbutton.html">QAbstractButton</a>&#160;<i>button</i>)</h3><p>Returns the button role for the specified <i>button</i>. This
function returns <a href="qdialogbuttonbox.html#ButtonRole-enum">InvalidRole</a> if
<i>button</i> is 0 or has not been added to the button box.</p>
<p><b>See also</b> <a href="qdialogbuttonbox.html#buttons">buttons</a>() and <a href="qdialogbuttonbox.html#addButton">addButton</a>().</p>


<h3 class="fn"><a name="buttons" />list-of-QAbstractButton QDialogButtonBox.buttons (<i>self</i>)</h3><p>Returns a list of all the buttons that have been added to the
button box.</p>
<p><b>See also</b> <a href="qdialogbuttonbox.html#buttonRole">buttonRole</a>(), <a href="qdialogbuttonbox.html#addButton">addButton</a>(), and <a href="qdialogbuttonbox.html#removeButton">removeButton</a>().</p>


<h3 class="fn"><a name="centerButtons" />bool QDialogButtonBox.centerButtons (<i>self</i>)</h3><h3 class="fn"><a name="changeEvent" />QDialogButtonBox.changeEvent (<i>self</i>, <a href="qevent.html">QEvent</a>&#160;<i>event</i>)</h3><p>Reimplemented from <a href="qwidget.html#changeEvent">QWidget.changeEvent</a>().</p>


<h3 class="fn"><a name="clear" />QDialogButtonBox.clear (<i>self</i>)</h3><p>Clears the button box, deleting all buttons within it.</p>
<p><b>See also</b> <a href="qdialogbuttonbox.html#removeButton">removeButton</a>() and
<a href="qdialogbuttonbox.html#addButton">addButton</a>().</p>


<h3 class="fn"><a name="event" />bool QDialogButtonBox.event (<i>self</i>, <a href="qevent.html">QEvent</a>&#160;<i>event</i>)</h3><p>Reimplemented from <a href="qobject.html#event">QObject.event</a>().</p>


<h3 class="fn"><a name="orientation" /><a href="qt.html#Orientation-enum">Qt.Orientation</a> QDialogButtonBox.orientation (<i>self</i>)</h3><h3 class="fn"><a name="removeButton" />QDialogButtonBox.removeButton (<i>self</i>, <a href="qabstractbutton.html">QAbstractButton</a>&#160;<i>button</i>)</h3><p>The <i>button</i> argument</p><p>Removes <i>button</i> from the button box without deleting it
and sets its parent to zero.</p>
<p><b>See also</b> <a href="qdialogbuttonbox.html#clear">clear</a>(), <a href="qdialogbuttonbox.html#buttons">buttons</a>(), and <a href="qdialogbuttonbox.html#addButton">addButton</a>().</p>


<h3 class="fn"><a name="setCenterButtons" />QDialogButtonBox.setCenterButtons (<i>self</i>, bool&#160;<i>center</i>)</h3><h3 class="fn"><a name="setOrientation" />QDialogButtonBox.setOrientation (<i>self</i>, <a href="qt.html#Orientation-enum">Qt.Orientation</a>&#160;<i>orientation</i>)</h3><h3 class="fn"><a name="setStandardButtons" />QDialogButtonBox.setStandardButtons (<i>self</i>, <a href="qdialogbuttonbox-standardbuttons.html">StandardButtons</a>&#160;<i>buttons</i>)</h3><h3 class="fn"><a name="standardButton" /><a href="qdialogbuttonbox.html#StandardButton-enum">StandardButton</a> QDialogButtonBox.standardButton (<i>self</i>, <a href="qabstractbutton.html">QAbstractButton</a>&#160;<i>button</i>)</h3><p>Returns the standard button enum value corresponding to the
given <i>button</i>, or <a href="qdialogbuttonbox.html#StandardButton-enum">NoButton</a> if the
given <i>button</i> isn't a standard button.</p>
<p><b>See also</b> <a href="qdialogbuttonbox.html#button">button</a>(), <a href="qdialogbuttonbox.html#buttons">buttons</a>(), and <a href="qdialogbuttonbox.html#standardButtons-prop">standardButtons</a>().</p>
<h3 class="fn"><a name="standardButtons" /><a href="qdialogbuttonbox-standardbuttons.html">StandardButtons</a> QDialogButtonBox.standardButtons (<i>self</i>)</h3><hr /><h2>Qt Signal Documentation</h2><h3 class="fn"><a name="accepted" />void accepted ()</h3><p>This is the default overload of this signal.</p><p>This signal is emitted when a button inside the button box is
clicked, as long as it was defined with the <a href="qdialogbuttonbox.html#ButtonRole-enum">AcceptRole</a> or <a href="qdialogbuttonbox.html#ButtonRole-enum">YesRole</a>.</p>
<p><b>See also</b> <a href="qdialogbuttonbox.html#rejected">rejected</a>(), <a href="qdialogbuttonbox.html#clicked">clicked</a>(), and <a href="qdialogbuttonbox.html#helpRequested">helpRequested</a>().</p>


<h3 class="fn"><a name="clicked" />void clicked (QAbstractButton *)</h3><p>This is the default overload of this signal.</p><p>This signal is emitted when a button inside the button box is
clicked. The specific button that was pressed is specified by
<i>button</i>.</p>
<p><b>See also</b> <a href="qdialogbuttonbox.html#accepted">accepted</a>(), <a href="qdialogbuttonbox.html#rejected">rejected</a>(), and <a href="qdialogbuttonbox.html#helpRequested">helpRequested</a>().</p>


<h3 class="fn"><a name="helpRequested" />void helpRequested ()</h3><p>This is the default overload of this signal.</p><p>This signal is emitted when a button inside the button box is
clicked, as long as it was defined with the <a href="qdialogbuttonbox.html#ButtonRole-enum">HelpRole</a>.</p>
<p><b>See also</b> <a href="qdialogbuttonbox.html#accepted">accepted</a>(), <a href="qdialogbuttonbox.html#rejected">rejected</a>(), and <a href="qdialogbuttonbox.html#clicked">clicked</a>().</p>


<h3 class="fn"><a name="rejected" />void rejected ()</h3><p>This is the default overload of this signal.</p><p>This signal is emitted when a button inside the button box is
clicked, as long as it was defined with the <a href="qdialogbuttonbox.html#ButtonRole-enum">RejectRole</a> or <a href="qdialogbuttonbox.html#ButtonRole-enum">NoRole</a>.</p>
<p><b>See also</b> <a href="qdialogbuttonbox.html#accepted">accepted</a>(), <a href="qdialogbuttonbox.html#helpRequested">helpRequested</a>(), and
<a href="qdialogbuttonbox.html#clicked">clicked</a>().</p>


<address><hr /><div align="center"><table border="0" cellspacing="0" width="100%"><tr class="address"><td align="left" width="25%">PyQt&#160;snapshot-4.9.5-9eb6aac99275 for X11</td><td align="center" width="50%">Copyright &#169; <a href="http://www.riverbankcomputing.com">Riverbank&#160;Computing&#160;Ltd</a> and <a href="http://www.qtsoftware.com">Nokia</a> 2012</td><td align="right" width="25%">Qt&#160;4.8.3</td></tr></table></div></address></body></html>